#include "types.h"

#ifndef _EEPROMFIFO_H
#define _EEPROMFIFO_H

#define	EEPROM_SIZE	0x8000

#define	EEPROM_WREN	0x06	/* write enable*/
#define	EEPROM_WRDI	0x04	/*/ write disable*/
#define	EEPROM_WRSR	0x01	/*/ write status register*/
#define	EEPROM_RDSR	0x05	/* read status register*/
#define	EEPROM_READ	0x03	/*/ read from memory*/
#define	EEPROM_WRITE	0x02	/*/ write to memory*/

/* eeprom status register*/
#define	EEPROM_READY	0x00	/*/ 0- ready*/
#define	EEPROM_WEN	0x01	/*/ 1 - write enable*/
#define	EEPROM_BP0	0x02	/*/ bit protection 1*/
#define EEPROM_BP1	0x03	/*/ bit protection 2*/
#define	EEPROM_WPEN	0x07	/*/ software write protection, 0 - off*/

extern	UINT16	fifo_head;
extern	UINT16	fifo_tail;

void	fifo_init(void);
void	fifo_put( byte* b, byte len );
void	fifo_put32( byte* b );
byte	fifo_pop( byte* b, byte len );
byte	fifo_pop32b( byte* b);	/*/ reads 32b of data*/

UINT16	fifo_free(void);
UINT16	fifo_buffer(void);

void	eeprom_spi_write( byte b );
byte	eeprom_spi_read( void );
#endif